<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
	<title>后台管理</title>
	
	<link th:href="@{css/bootstrap.min.css}" rel="stylesheet">
	<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet">
	<link th:href="@{/css/nprogress.css}" rel="stylesheet">
	
	<!-- 自定义样式 -->
	<link th:href="@{/css/custom.css}" rel="stylesheet">

</head>
<!-- footer_fixed 固定页脚 -->
<body class="nav-md">
	<div class="container body">
		<div class="main_container">
			<!-- 用户信息,左侧菜单 -->
			<div th:replace="main/left :: left"></div>
			<!-- 页头 -->
			<div th:replace="main/top :: top"></div>

			<!-- 页面主区域  -->
			<div th:replace="main/right :: right"></div>
			<!-- 页脚  -->
			<div th:replace="main/footer :: footer"></div>
		</div>
	</div>


	<script th:src="@{/js/jquery.min.js}"></script>
	<script th:src="@{/js/bootstrap.min.js}"></script>
	<script th:src="@{/js/fastclick.js}"></script>
	<script th:src="@{/js/nprogress.js}"></script>
	<script th:src="@{/js/validator.js}"></script>
	<script th:src="@{/js/jquery.dataTables.js}"></script>

	<!-- 自定义js -->
	<script th:src="@{/js/custom.js}"></script>
	<script type="text/javascript">

	$(document).ready(function(){
		
		$.ajax({
                type: "POST",
                url: "/setting/GetCurrentTheme",//url请求的地址
                cache: false,  //禁用缓存
               
                 data:{id:0},
                dataType: "json",
                success: function (result) {                    	
                	window.theme=result;   
                	console.log(result)
                	changeTheme(result)
                }
            });
		function changeTheme(theme){
			$(".left_col").css("background",theme["left_bg_color"]);
			$(".nav_title").css("background",theme["left_bg_color"]);
			$(".sidebar-footer a").css("background",theme["left_bg_color"]);
			$("body").css("color",theme["left_bg_color"])
			$("a#menu_toggle").css("color",theme["left_bg_color"])
			$(".sidebar-footer").css("background",theme["left_bg_color"])
			$(".nav.side-menu>li>a").on("click",function(){
				$(".nav.side-menu>li.active>a").css("background",theme["left_bg_color"]);
			})
			
			
		}
	})
	</script>

</body>
</html>
